function myReport(){
//����heightchart
this.createChart = function(datas){
	//字段value改为 heightchart的 y
	var obj =datas.data;
	$.each(obj,function(i,r){
		r.prototype="y";
		r["y"] = Number(r["value"]);
	});
 	$('#'+datas.domId).highcharts({
        chart: {
            plotBackgroundColor: null,
            plotBorderWidth: null,
            plotShadow: false
        },
        title: {
            text: datas.title
        },
        tooltip: {
           /* pointFormat: '{series.name}: <b>{point.percentage:.1f}%<br>{point.y}人</b>'*/
        	pointFormat:datas.pointFormat
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                dataLabels: {  
                			enabled: true,  
                	        useHTML: true, // 一定要加上 
                	        format : "<p style='width: 60px; display:inline-block; white-space:pre-wrap;'>"+datas.format+"</p>"
                	       
                	}  
            }
        },
        credits:[{enabled:false}],
        exporting:[{enabled:false}],
        series: [{
            type: 'pie',
            name: '占比',
            data: obj
            }]
    });
 }
//折现图
this.createZChart = function(datas){
	/*var date =datas.date.split(",");*/
	var max = Math.max.apply(Math,datas.data);
	var min = Math.min.apply(Math,datas.data);
	$('#'+datas.domId).highcharts({
	        title: {
	            text: '消费类型分析'
	        },
	        xAxis: {
	        	title: {
	                text: ''
	            },
	        	categories: datas.x
	        },
	        yAxis: {
	        	 max:max,
	        	 min:min,
	        	 tickInterval:300,
	        	 title: {
		                text: ''
		            },
		            plotLines: [{
		                value: 0,
		                width: 1,
		                color: '#808080'
		            }]
	        },
	        tooltip: {
	            headerFormat: '<b>{series.name}</b><br />',
	            pointFormat: 'x = {point.x}, y = {point.y}'
	        },
	        series: [{
	            /*data: [1200, 1230, 1000, 1400, 1250, 1310]*/
	        	data:datas.data
	        }],
	        legend: {enabled:false},
	        credits:[{enabled:false}],
	        exporting:[{enabled:false}],
	    });
}

//ͨ���ʺ���
this.setTglPic = function(imgs,tgl){
	tgl = this.toPoint(tgl);
	$.each(imgs,function(i,r){
		if(i<5)
			$(r).attr("src","images/cjbg_01.png");
		else
			$(r).attr("src","images/cjbg_03.png");
	});
	$(imgs[getIndex(imgs,tgl)]).attr("src","images/cjbg_02.png");
	function getIndex(imgs,tgl){
	 	var index = Math.floor(tgl*10)-1;
	 	return index;
	 }
	}
//百分数转小数
this.toPoint = function(percent){
	if(percent){
		var str = (parseFloat(percent)*0.01).toFixed(4);
		return str;
	}else{
		return 0;
	}
}
//学习计划
this.dashbord = function(d,deg){
	$(d).animate({
        aa:deg //目的就是取一个属性值360
    },{
        step:function(now,fx){
            //console.log(now);
            $("#dashbord_01").css({"transform":"rotate("+now+"deg)"})
        },
        duration:10
    });
}
//取随机颜色
this.getrandcolor = function(){
	var arr = ['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'];
	var color = '#';
	for(var i=0;i<6;i++){
		color += arr[Math.round(Math.random()*15)];
	}
	return color;
}
//每日任务圆弧
this.daily_gaugechart = function(pre){
	var canvas = document.getElementById("gaugechart");
	
	if (canvas == null) {
         return false;
     }
//	$("#gaugechart").css("width",canvas.width*2);
//	$("#gaugechart").css("height",canvas.height*4);
	 var ctx = canvas.getContext("2d");  

	    //开始一个新的绘制路径
	 console.log(ctx);
	    ctx.beginPath();
	    //设置弧线的颜色为蓝色
	    ctx.strokeStyle = "#12b7f5";
	    var circle = {
	        x : canvas.width/2,    //圆心的x轴坐标值
	        y : 90,    //圆心的y轴坐标值
	        r : 75      //圆的半径
	    };
	    //沿着坐标点(100,100)为圆心、半径为50px的圆的顺时针方向绘制弧线
	    if(!pre || pre==" "){
	    	pre="0%";
	    }
	    var txt="签到率高于全校";
	    var txt1=pre;
	    var txt2 = "的同学";
	    ctx.font = "12px Arial";
	    ctx.fillStyle = "#12b7f5";
	    ctx.lineWidth = "4";
	    //弧线
	    ctx.arc(circle.x+0.5, circle.y, circle.r, Math.PI*0.25, Math.PI * 1.5/2 , true);  
	    //签到率高于全校
	    ctx.fillText(txt,(canvas.width-ctx.measureText(txt).width)/2,55);
	   
	    //百分比
	    ctx.font = "36px Arial";
	    ctx.fillText(txt1,(canvas.width-ctx.measureText(txt1).width)/2,110);
	    //的同学
	    ctx.font = "12px Arial";
	    ctx.fillText(txt2,(canvas.width-ctx.measureText(txt2).width)/2,130);
	    //按照指定的路径绘制弧线
	    ctx.stroke();
	    ctx.closePath();
	    //绘制灰线
	    ctx.beginPath();
	    ctx.strokeStyle = "#3d97b8";
	    pre = this.toPoint(pre);
	    var p = 2.249 ;
	    if(pre>0){
	    	p = p -1.5*pre; 
	    }else{}
	    ctx.arc(circle.x, circle.y, circle.r, Math.PI*0.25, Math.PI * p , true);
	    //按照指定的路径绘制弧线
	    ctx.stroke();
	    ctx.closePath();
	  /*  绘制直线*/
	    //直线
	    ctx.beginPath();
	    ctx.lineWidth = "2";
	    ctx.strokeStyle = "#12b7f5";
	    ctx.moveTo((canvas.width/2)-60+0.5,70);
	    ctx.lineTo((canvas.width/2)+60+0.5,70);
	    ctx.stroke();
	    ctx.closePath();
	
}
}
